package com.zwd.cases.demo.gof23.strategy.cashstrategy;

/**
 * @Description 打折收费子类，初始化时必须输入折扣率，如8折就是0.8
 * @Author zhengwd
 * @Date 2023/4/12 14:37
 **/
public class CashRebate extends CashSuper {

    /**
     * 折扣率
     */
    private double moneyRebate;

    public CashRebate(double moneyRebate) {
        this.moneyRebate = moneyRebate;
    }

    @Override
    public double acceptCash(double money) {
        return money * moneyRebate;
    }
}
